Fix the parsing bugs, ready to be further tested