Added Error reporting and support for empty parameters.