Get rid of all warnings and errors on Windows.

This increases msvc compatibility.
Maybe turn RANDOM() into an inline function Random()?