Added some unit tests and fixed the mythtv ones