Fix build and remove old code