Fixed parameter handling and added new parameters.