Fix function signature to return data type as exposed API. Fixes #195.