Added support for defaultNum. Fixed strange bug that causes validation to fail sometimes.