Added more checks to send function for integer and real types.