Fixed database configuration and data write procedures.