Fixed build dependencies and removed dead code