Fix map lookup to throw if invalid test