In medley script(s), when executing maiko (lde or ldeinit) check if its on the PATH before looking for it in MEDLEYDIR/maiko or MEDLEYDIR/../maiko.
Note that medley.sh is just a symbolic link to medley.command (to accomodate MacOS). medley.command should not be edited directly. It is compiled from all the of the medley_*.sh components. The script compile.sh does this compile (with help from the inline.sh script).