Added comment support and handled empty statements properly