Make the debug buttons work if the code is called after

DOMContentLoaded.