Bug fix for polymorphic associations