Fix print statement to print function and add some test coverage.