Another fix for the static (de)initialisation fiasco.
Couple of fixes for error codes/categories.