Update database and fix syntax