fix broken build
fix broken test

Always initialize variables to avoid running into undefined behavior.
cleanup

Keep the 2n+1 logic in a single place.
Make it more clear that the new_ local vars are to guard against the error
condition of running out of memory. (Wish we could write a test for that!)