Fixed a type and reordered the case statements

Making in more inline with the existing code…