Debug flag usage + other finetunings