fixes and improvements
Merge pull request #41 from chrisyip/fixes-and-improvements

fixes and improvements