Gloucestershire still trail by 391 at stumps with nine first-innings wickets remaining