Fixed some details in the statement generation.