Fixed bugs with db & keys loading