Various fixes
Merge pull request #2 from vranki/master

Changes from vranki