Fix some callback errors and finish database connector