Fixes syntax errors and some edoc