instance_methods etc should not include undef'ed method names; based on a patch from @cremno; fix #2613

Conflicts:
	src/kernel.c