Fixed permissions and logging.