Bugfix 12860

@davelxmos @ThomasGmeinder 

Please review bug fix for bugzilla 12860. Thanks.