Fixed makeIndex() in Database class