Fix occurs scoping bug