Fix bug report 776

I have automatically trim trailed space selected on my editor - that's why the supplementary changes... Don' think is a bad thing though...