Added various fixes

Look out for commented lines - they are "To Do"!