minor bug fixes and perm changes