Fix issue parsing middleware options