Fixed infinite loop: Github issue 104.

I fixed the small infinite loop issue reference in issue 104. I changed the for loop to not run if the list is empty, returning null instead. I also made a small modification to the removeTag() function to handle the case when the tag does not exist.