Miscellaneous reorganisation and minor fixes.