Fix bug with heap memory free in the 1bxxx templates