Fix method definition in exception message