Bug fixes for multiple element support