Fixed error reporting if no compound is found.