Fixed bug causing reduce queries to fail. Also fixed bug causing design docs not to work when they didn't contain at least one index on the document class