Fix implementation of UNREACHABLE and AUTODETECT