More tweaks to try and fix 64bit compatibility. Also added an alternative
uniform random number generator implementation to try out.