Some more refactoring, fixes to ensure big-endian in convert_int