Test cases for lottery scheduler and fixes