Fixed some minor issues, tested it with real PiFace hardware

Sorry for cluttering the diff with whitespace changes. My IDE cuts trailing blanks and swaps out inconsistent line breaks automatically.