Improve handling of null/empty parameters