fixed some compile issues for both debug and release