If you try to look up an OSM tile which is exactly on the top left corner of the valid extent then rounding errors can creep in that cause the YIndex to go negative.