Fixed building, removed unused code