Critical bugfixes