Added typed function wrapper and tests