Making middleware optionally arrays and updated comments