Replaced old uint32_t return types to err_code, where applicable. Fixed references to removed or changed things.