fixed #5699
fixed #5700
Merge pull request #115 from kermie/b-5.1-ce_5700

fixed #5699 and #5700