In assembly module preserve execution file permissions and improve error
handling