Workaround for #5652: Force size to 0 if negative.

Should be fairly safe, and passes tests nicely.