Tests + some fixes for permissive header parser