Formatting
New kind of error handling. Fixes #30

Less hacky, works much better than the last version.