Some fixes for note editing and adding