Fixes applied to prevent crashing and reseed RNG for NB