Fix method return value in write context