Minor optimizations

A few minor optimizations to quoteIdentifiers(), when enabled this method easily comprises a large part of the request so every little bit helps.