Fix compile warnings in release build