Add global errors to error constants

closes #416
closes #518