fixed some issues.
Merge pull request #1 from ivg/master

fixed some issues.