Remove dead code, fixes #2363