Remove trailing spaces
Fix encoding problem in python 3