Fix code for latest changes