Better Extension Dir

Fixed detection of extension_dir in some environments