Added code to remove temporarily-generated subroutines.