Additional fixes for debug version