Fixed indent
Added more logic to the shared test code