Merge genstat updates into phil's branch