Add tests, fix int parser
corner cases cleanup