Add unit tests for space bug