Added locking, added 2process test, made exceptions work