Removed dead code; fixed deprecated things.