Implemented testing for 'friendly errors', fixed a few issues with error checking in general