Consolidate mark read logic; fixes some bugs