Throw error on duplicate middleware, closes #32.