Fix note script for title renaming

Also add a debug print statement for when NOTES_DEBUG is set.