Code cleanup, added lang=None back in, and changed bad lang to new kind of error