Bunch of code upgrades and bugfixes