fixes for permissions on keyfile