fix bugs.
Merge pull request #2 from padule/fix/bugs

fix bugs.