Merge "Added more conditions for setup and tear down."