small fixes to param names and few sanity checks