Fix error message for unsubstituted variables

Add additional tests
Reformat project with netbeans
Fixing exception test