Fixes bug in greedy resource scheduling