Remove trailing whitespace
Add more logging