Add debug flag. Closes #1.