Initial Perm changes and some code cleanup.