Changed error handling for read.sequence