Parse integers properly