Fixed problems pointed out by KA101