Some bugs fixed

Hi Ake,

as I see, it works perfect and really fast. So here comes the next one. ;-)

Best regards
Andreas