Fixed error handling to work with new kvp args