unit tests and whitespace bug fix