Fixed bug in chk_param