At the time of writing this script it was unknown if there would be a season four. The writers decided to finish the season as if there wasn't, which explains the happy endings for some of the characters. Season four was confirmed before the final episode went to air.