Fix code issues