Fix tmp path checking
Cleanup