I think you want `spec = $.extend(spec,...)`, not sure how this works as is.  I know I fixed an instance of this recently that you may have copied from, not sure how that worked either.