Tidy up of backwards compatibility code.