Add ability to specify custom filename

Also some improvements to docs and error mesages