fixing some issues with printing of *QL statements