Fix createTree to work with binary content.