removed an infinite loop on osx
fix test

removes leading spaces in the results