ex1: fix compilation errors

Also, clean up whitespace.