Bugfix: replace explicit path concatenation with a call to 'fullfile' to
make the code more portable.
Add missing 'end' keyword to some functions.