Errors fixed at the buffer read method and some exceptions.