Fixed bug in get_active_path() function