Initial commit with ~direct copy from version 2.2.4