Fix handling of nested values