Added Error messages:
    UNEXPECTED_INPUT_END
    UNDEFINED_REFENCE

Added {} for functions.