Add khatm types and fix bugs