Fixing 'method return value in write context'