some bug fixes to simplesurface.py