getAsInteger returns true on error. Oops.
No test because the behavior at the moment is identical with or without this change.