Improved error handling, fixed missing data issue

Fixes https://github.com/CloudyKangaroo/cloudykangaroo/issues/98