Fix issues #1116 #1438