Minor bugs fixed in key conversion

Hi Christian, as proposed by email please check my bug fixes which also include the comment by bugwas in your blog entry.

Regards... Bert