Fix some bugs; Update db