Fix notices and using not-defined variables

Could you align the parameters for this?