Fixed #969, #971