More general fixes and marking things with TODO