Fix some bugs in decoder

* Fix a possible nil crash
* A multiline session file is now supported
Merge pull request #4 from Shinpeim/fix_bugs

Fix some bugs in decoder