improve $() expression; fix relative path