Switch to using errbit for error handling