Fix for return value in write context