Fix some bugs
Remove unused file