Bug fixes and print statements