Fix for possible crash in deprecated code. Also fixed bug offsets, now much smaller and properly aligned around 0.