Fix caching for binary elements. Issue: #4