Fixed a major bug with getting coordinates and checking if elements are in viewport