Bug fix of parsing SQL