Fixed bug that occurred during DEBUG builds