Fixed most compiler warnings