fix two errors; thanks misha