This reverts #934, but takes into account the mistakes that were fixed there. Signed-off-by: Hidde Beydals <hello@hidde.co>