added support for empty paths and error handling for alpha fns