Fixing bug 1245