Fixed bug where a mutex would not unlock properly, which froze the GUI