Fixed bug in middleware where response.status used old method.