Tons of bugfixes