Fixes printFile

Had some errors with the arguments parsing. Also adds a little test
script to try this out.