Fully fixed issue #25 and issue #20; removed debug output