small fixes, unused code removed