Fixed bug in projection queries on one repeated property and some unrepeated.

Bug was causing internal datastore error (InternalError). Fixed and added some testes.