Bug fixes and additions.
Merge pull request #3 from lebarsfa/master

Bug fixes and additions.