Sync ES with the oficial version

See #373 and #372