Fixed bug causing expansion to fail if spacing is imperfect