Various changes inspired by work on the 3.0 plugin