Static middleware: fix compilation
Instructive error messaging when adding handlers
Update TODO