Fix JSON deserialization of samples property.
Rename function parameters so they don't conflict with table column names.