Fixed Database Generation Script

As in title.