Fix path checking order to fix Mac/Linux path lookup.