Improved tile detection