bugfixes, finalization