Code from version 2.1RC1