Added print, which segfauts, also bugfixes