Another attempt at bugfixes.