Fix some bugs mentioned in #14, change version to v0.1.2