Minor fixes and Dahai functionality