Buckingham Palace finally became the principal royal residence in 1837, on the accession of Queen Victoria, who was the first monarch to reside there; her predecessor William IV had died before its completion. At the end of which year were most of the design problems of the palace rectified under Prince Albert?