Increasing test coverage and fixing bugs found while writing tests

Same issue with `print` call here.