Lint, remove old code, fix endless loop