FIX: handling of debug mode

Change-Id: I35773b2f809f06a763c86e1fcc093e4b4e20a48a