Revert "Revert c changes"

This reverts commit 1a47141f527ad42e353e3e4340114074405705ac.
Random number type conversion fix