Handle and scrub ending _controller gracefully in controller generator