Made a bit better parameter handling.