Added checkOrigin test which led to fixing a comparison bug.