Fixed space affecting test and added new test for sub selects