Try fixing messages auto-scroll

Prune messages while still allowing the length of the messages array to change.