Fixed bugs on Database class!