StoryTable.php: Fixed a bug in 'getNextAvailableStory()' function