fix ranked relevance unicode bug in metadata searches, plus other minor fixes