Fix type detection for association attributes.