only set error if there is one
bp: fixed tests