Fixed reference errors and made DB static.