The call to do_chmod() needed to be conditional.