Fix bug 3236 (local reference)