Fixed the auto param detect code