Bug fixes + Database stuff