Bugfixes, made it work in an obfuscated env