More operations and bug fixes from James H.