Bug fix for correct ordering of defaults for options/middleware