TODO and compile time warnings fixed