Better remote error handling + cleanup