Fixing issue where views would disappear. This also replicates the code that's present in the 2010 WWDC session 104.