Fix parsing of undefined references