Fixed target object not being caught by the scrollTo function.