Adds code and tests for handler return type conversion.