Fixing minor bug in swapCase function