ex1: fix compilation errors

Also, clean up whitespace.
Merge pull request #2 from listx/master

ex1: fix compilation errors