Finish bugfixes from the refactor.