Fix dir check.