Changed else if to else.
Fixed how an error is thrown.
Added check on names and ages.