Fixed crash caused by a cast problem.
This seams to fix the memory leak when checking if water can freeze.
Merge remote-tracking branch 'origin/master' into StaticTrees