Correct bugs and remove unused items.