Bugfixes print function; added some improvements