Add validation of idnumber, Fixes #19 #24