Core/Misc: Fixed gcc build and some warnings