fix argument handling when cm / cmi is invoked in a symlinked folder

@tfoote @wjwwood Please review and try the cm / cmi commands for doubling checking that it doesn't break anything.