Fixes bug when debug is enabled.