Fix the way invalid ticket is detected
Make test cleaner and more self-sufficient
Update changelog
Bump version 0.3.0 => 0.4.0