Fix bug in multiplying function.
Add tests for numeric functions.