fixed the off by one bug in gsub, and enabled various related tests