Various bugfixes for our changes.