Fixed so the empty method don't break on read-only elements.