Fix path when undefined object passed