errors found by Filip Srovnal