Added check for correct method return type and arguments before calling it through reflection.