Add protection against MaxY=0