Fix issues #10, #11, #12

Besides removing trailing whitespace (my editor did that automatically), this fixes #10, #11, #12.