Fixed bug with registering TEs