Updated from upstream simbit.