Spec compliance fixes and other improvements
Get rid of unsafe make_num