Added tests for bug 0001047