Twyzl + Paelex code cleanup + bug fixes