Update to version 0.5

Support for new encoding methods with better error handling.
Fix issue #11