Fixing bug #3285.
Adding a test for bug #3285.