Fixed several issues with the scanner when dealing with block tokens. Fixed a segfault that occurred when a syntax error occurs in a query.