Fixes to number generation