Fix safe_bytes call in exception handler