Removed even more code from middleware that doesn't seem to work.