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

Bug fixes and additions.