First batch of fixes from Filip Srovnal.