fixed #5 and #6

Also fixed test suite. There's still a failed test, but I don't know how to fix it...

Please minify it by yourself as I don't know which tool you are using.