fix(shallowCopy) logic error where '$foo' would be ignored