Closes #21. Adds some debug.