Adding tests and accounting for null case.