Fixed ticket validation bug. More unit tests.