Multiple bugfixes