Fix marker position detection