A few fixes.

A few commits adding a little 1.5.1+1.5.2 compatibility, a couple of optimizations, and a fix for gravestones deleting items when using mods with custom player inventories.