Clarify and cleanup LDT initialisation and MAGIC_NUMBERS. Courtesy of haxar