Issue 3494: Now with tests