Some minor changes for handling fragments