Add better exception handling.
Fix error strings.
Merge pull request #5 from JuhaS/master

Add better exception handling.