Various fixes for passage analysis