Fix bug when getting stmt type