fixed some bugs for use with bootstrap style dropdowns