NH: Fixed bugs related to $select and $expand