Added blank lines.
Simplify variables assignment.
Simplify production checking.
Simplify if/else statement.
Merge pull request #189 from gmist/minor_fixs

Minor fixs