Fix error when there are no sprites