Lots of bugfixes
Merge branch 'testing'