Changed 'static const' constants to precompiler constants and made the init function more resilient.