Fixed all warnings, a lot of small fixes