Fix bug in identifying ActiveRecord classes