Fixed 'bpath is null' error