Fixed bug in handling of scalar foreign functions and clarity wibbles
Redux "fix: canonicalizePath fails for non-existent directories"

This reverts/fixes commit 8ff5593f0cfe560b15e345867fc030113c081125.