Partial manual merge

Ezfe's changes