minor ksh (and possibly POSIX) fixes