Fixed: 'end' in main scope is not treated as valid anymore
Added: simple function parsing