Cleaned up edge-cases in string numeric conversion methods, and added some extra unit tests.