Port to 2.2 API

Signed-off-by: Jens Georg <mail@jensge.org>