Fixed bug where rest note returns the rest function by accident