Check for read-only object as well. Thanks, Johann!