Added checks for incorrect parameters