Bug fixes.
Merge pull request #3 from pradn/master

Bug fixes.