Add CDE modes + some small fixes