Changed error handling. Duh. References #7