fix bug 2294 (finally).