From David Callu, warning fixes and removal of spaces at end of lines.