cmdmod: should be `if`, not `elif`; CWD validity check shouldn't be Windows-only