64-bit random should be fixed now
sprintf -> snprintf and better log messages