Minor fixes, removed dead code