There seems to be no consistency with PMs who were known by their middle names. Andrew Bonar Law and James Ramsay Macdonald only show as correct answers when their first names are typed and not when the names they actually used are entered. However, James Harold Wilson, James Gordon Brown, Leonard James Callaghan, Maurice Harold Macmillan and Robert Anthony Eden require the name actually used and their first names are not considered valid. Alexander is not accepted even though it is the real first name of Alec Douglas-Home (who used a short form) and Boris Johnson (who uses his middle name)
These are the names provided by the official government website as provided in the caveats above therefore I won't change how they appear, however I'll go through and add in the type-ins you've requested and any others that apply