Fix some syntax errors and add dump method