Add guard conditions for min/max parameters

Change-Id: I9cc1c9f90cb905870edfb72b83f5ef9313f148a3
Reviewed-on: http://gerrit.causes.com/37708
Reviewed-by: Shane da Silva <shane@causes.com>
Tested-by: Shane da Silva <shane@causes.com>