Fixes #9

This should ensure we're not clobbering any existing files and removes the unnecessary unsafePerformIO