Tons of fixes

Tons of lagging changes finally commited, carefully gitted added -ped. 

@dpavlin please take a look.