Police that reg_max_expires is a positive integer (fixes #184)
Don't declare variables in a case statement
Merge pull request #185 from Metaswitch/issue184

[Reviewer: Mike] Check that reg_max_expires is valid before using it