[thaller@redhat.com: patch merges parts from originally three separate patches, add some whitespace fixes]