A lot of bugfixes and new stuff