A stretch to call this a bug report, but...
<div id="messages"> is written when no messages are inside it. I've had a few styling problems that were easier to solve with the #messages
<div> omitted unless there are messages to display. Patch below.