Code from v4.1 RC