corrected a few errors in the T4 file

Fixed the following:
- if no enums were selected, then a closing curly brqacket was still
generated causing an error;
- if scope object was passed in, the connection was still called
connection.Open() causing an exception
Updated version 1.0.1 to version 1.0.2
Merge pull request #1 from rtumaykin/dev

Fixed bugs  - closing curly bracket & connection reopen attempt