Fixing the issues #1212 and #1213