Improve error message handling and reporting

Perhaps should not just be printing to stderr, but better than nothing?