Fix to correct checking of '$' name termination.