better writeable flag fix

+ a warning fix