fixed issue #548, #562, #549, #547, #543
Merge pull request #567 from safiyu/newissue

fixed issue #548, #562, #549, #547, #543