Cleanup, bugfixes, improved print