I don't think this works for cases where the param is boolean, not sure if that's important.