Fix for ticket #23

Implement better quotation for all statements, adding new tests.