Adrian,
This seems to be a bug in the platform, still present in 5.2.x I suggest filing a ticket for this.
This has been fixed in Mendix 5.21. It just missed the deadline for the 5.20.
Edit: I know that at the moment it's not yet released, we'll probably release it next week barring any unforeseen circumstances.