don't report SQLITE_OK as an error
add missing headers