Make the parameter handling a bit more robust