Fix a memory leak and add in an option to allow some "invalid" numbers