Bugfixes. Renamed and reshuffled things.