Fix appending and prepending text and buttons