Working through jQuery glitches