Touch up for debug proc and unrelated fix

This moves to a switch statement for debug proc since table didn't work out as the values aren't contiguous like I had originally thought. 

The other commit is self explanatory.