Trac #590 - min and max arguments are somtimes ignored.
Merge remote-tracking branch 'origin/devel' into devel