Fixing bug with extra whitespace in results