Fix removing temporary file. Fixes #160.