Merge "Cache element type in allocation." into jb-mr1-dev