Fixes for ActiveRecord queries related to Person model