Fixed an obvious bug in min and max definition, though it doesn't resolve the llvm error