Fixed a tiny bug in surface.js