Various fixes so the KaKs example works