fix var reassign check and add tests