Pull request for feature request #112

Contains required tests and modifications to close feature request #112

[Closes #112]