Added bit setting/getting routines and changed return codes