added missing unique constraint
test fixes and cleanup of exception catch