Fixed bugs from database revamp

Renamed old references to old database