Issues #1 & #2

Fixes for issues #1 & #2 also the start of #3