fixes in global init, moved db schema code