Fixing substring issue that prevents detecting a query that contains *

This fixes issue #171 by properly detecting the case where a query begins with an asterisk so that the table name is prefixed.

Sorry there are no tests for this as I am not sure how to add tests for this project. I'm happy to add them with a bit of guidance.