Another attempt to fix, courtesy of simontabor/jquery-toggles#8