Fixed a few bugs in param parsing