Added freeing token method. Unit tests updated