fixes, optimizations, API changes for greater compatibility with pre-6.3.x mods