fix ticket 565, ticket 566
Merge pull request #10 from xiechao06/ticket_565_566

Ticket 565 566