Cleanup trailing whitespace
Fix functional tests