fixups on err