fixes #2822 - Return codes should be defined at one place