Added number of params checks for top-level functions