Print statements and more bug fixes