Added 'rests' and minor fixes