Fix bug when custom date parameter is not used
Cherrypicking from plugin_namespace branch