Fix deprecation warnings.

Signed-off-by: Aron Cedercrantz <aron@cedercrantz.se>