Made reading from buffers work

a missplaced buffer.flip() was to blame
Added more helpful error messages