Revert "Fix double inclusion of system_entities table"

This reverts commit db7e5d58a9ece93a30beb539aa3a3b2c13f8581e.
Apply Mark's fix to :accessible_by and fix one other issue.