Updated save/load state
fixed oam size
better error handling