Fixes for IE7 and older, improved .i method