Added a space before END in the statistics update query. Closes #51.