Fix position setting bug.