Extra checks to make library file handling more robust.

Fixed bug in Sickle for getting output files.