fixed issues pointed out by bjorn