BUG: needed to double compile for cross-refs