misc small fixes, added some TODOs