fix root access permissions after upload
typo
add a debug switch for developing convenience