basic error codes, more structural tweaks