I have a batch class that runs on all leads unless the user has entered a specific lead Record Type into a custom setting field. I'm getting an "System.QueryException: Invalid alias" even though when I have tested out the query in the query editor and it works fine. Below is the code for the base batch query and the expanded one if they have entered a lead type.