Remove GUI-related stuff
Remove unused stuff and fix several warnings