Fix the bugs! :D

and formatting
Merge pull request #8 from gomeow/master

Fix the bugs! :D