Fixed updating
(and some embarrassing compile errors)