Fix gets writing out of given space