Fixes issue #998.

Fixes multiple issues with the way PR #997 was implemented. 
@TShapinsky if the object's not going to change, it's better to create one instance, and keep it around, then a new instance every time you use it. 
This avoids unnecessary garbage collection.