Fixed up buffer length checks