Correct / refactor integer parsing