Updated derivative temp file deletion.
Updated temp file management.