Cleanup middleware and project model

Prevents #584 from crashing strider, and cleanup.