Fixed tmp files cleanup