Fixed builderrors and removed unused references