Fixed temp file not being removed.