Cleaned up random int generator code.