Result needs set to null before appending numbers

Otherwise we end up with “muff1234” etc
Switch case needs to be in an else statement, otherwise we reset $result back to $kind (default in switch)
Use the already available if/else statement level
Change else if to match others in file (instead of elseif)
Merge pull request #22 from scottrobertson/fixes

Few fixes here (Urgent, current release wont work)