Some bug fixes to the physical allocator

I'm sure there's more, these are the few that were caught during a code
review