Add functional tests for duplicate errors