Some general fixes and error handling
1.0.1