Fixed issue with indices not initialized if no query is given