Bug fixes

Sorry for the file permission changes.