Various refinements and bug fixes
Merge pull request #55 from altitudelabs/bug-fixes

Various refinements and bug fixes