parser: better error handling
exmaples: some fixes
element: fix function prototype