Bug with generating < and > and a possible solution

Please refer to this.