Removing unused function
Making primary key errors more informative