Return button as html instead of echoing them

Hi, this is the same change for the master branch, like I described it for the STABLE 25 branch.