Fix empty param issue and print a nicer error message