Fix a few bugs and add a restart button