Fix (hopefully) last bugs caused by database field renames