Made some changes to numfig.py to try and alleviate an exception when compiling with HTML.