specs and fixes for middleware
release 0.2.1