Fix compile errors in debug mode