Updated to work with Tornado 3.1.1