Fixed bug when building after updating, removed redundant code