Fix some bugs
Remove more unused things