Added some error checking to core::read.