Fix the issues #420 and #427.