Update for library changes
Get rid of obsolete syntax hackery
Improve duplicate key error message