- Replaced calls to Math.max with own function because Math.max wasn't working properly in latest Spidermonkey (?). - Fixed some code that could cause weird ridges to appear. This was SVN commit r5221.