Note generating function bug fixed.