R5.0 code and memory restructure, ERR and BG handling