fix *_end hooks being passed an empty node list

thanks @mfriedenhagen