Fixed a number of issues, fixed style etc.
Merge pull request #26 from busho/master

Fixes, updates...