Fixing bug 1131