Fixed two lower level database bugs (multiple master table entries and scores in table names). Corresponding unit tests have been added