fix mistakes pointed out by Martin