Fix bug selecting from / when / is an array, and support LIMIT clause