Fixes for #393, #396 & #392

Fixes for #393, #396 & #392