Fixed a problem with snapToTocWidth().