Numerous fixes and updates
Merge pull request #2 from bayandin/fixes

Numerous fixes and updates