Issue #152
Issue #153
Test scripts
Minor refactors