Add support for DISTINCT keyword, fixed doctrine limit bug