Fix param detection, added test