Better checks of input parameters