test -f -> -d

Sorry about the careless mistake.