Add -Wall -Werror -O2 to cabal (sane style).
Fix errors by -Wall -Werror (warnings).
Hlint.