Every button in the UI causes an infinite loop

Yep, I managed to figure it out. Check my answer below for the details.