Handle case where avail_size=0
did you forget to commit something? <-- yes