Fixed bugs with backwards compatibility code.