Adding a new test case for testing FLAGIFFUNDEFINED + bug fixes