Cleaned up the stability functions
Fixed stability function bug in surface scheme