Code consistency fixes