Merge fixes from other fork.