Lots of fixes in the detail view controller to handle buttons.