Bugfixes and improvements; replace checkIP() with isValidIP()