Revert "Removed unused code that breaks certain use cases (Fixes #234)."

This reverts commit 5894a437cdcc28a8fb32f80691dd30af4b3ac50d.