Fix for edge case around sub attribute queries.