Fixes #406
Fixes #405
Merge pull request #407 from delving/issue406

Fixes #406 & #405