Fix wrong dir, and add debugging code.