fixes #56
fixes #55
fixes #57
Merge pull request #62 from songz/bug-fixes

Bug fixes: 55, 56, 57