Handling None case and int parsing better