Bugfixes from prior commit.