Fix bug and add testcase for compile error line numbers