Fix issues #1051 for 1.3.0