Improved some of the code for the show/hide history button based on comments from Bart's code review.