Fix issue #905, #910

Fix issue #905 #910