Don't rely on browser .indexOf. Fix #8