Corrected scalar/vector-valued functions of vectors/matrices