Fixed tmp handling