fixed basedir path when using a trailing slash, closes #374