FIX: Caps and pytest (#482)

* FIX: Caps and pytest

* FIX: Check in code

* FIX: Check for unique names

* FIX: Minor fixes

* FIX: More checks
7 files changed