Adding a register map function, fixing some errors in array access functions and invokers.