Updates to some files for legacy compatibility and bug fixing.