Fixing bug 1181