Merge pull request #13 from yamanetoshi/Issue#12

Fix Issue#12
Fix Issue#9
Fix initial register bugs