Issue 363 clean

Includes previous fixes. A growing divergence between this and base repo.