Fixed the database script and account managment

Signed-off-by: Gregory Klupar <Klupamos@gmail.com>