removed declspec property declarations, not portable
using qualified min and max functions, explicitly specifying template parameter in case of ambiguity