Fixes primary key and variable name generation.