Preheat oven to 350 degrees and spray a 1 quart baking dish with cooking spray.In a small saucepan, melt the butter. Add the onion and cook for several minutes until the onion is soft.Add the flour and cook for 2 minutes, stir constantly.Whisk in the milk, stirring constantly, bring it to a simmer and cook for 2 more minutes.Remove pan from the heat and add salt, pepper, a dash of nutmeg (if using) and 1 cup of the shredded cheese. Mix well until cheese is melted.Spread out half of the sliced potatoes into the bottom of the baking dish and pour half of the cheese sauce on top.Repeat to make a second layer.Top with the remaining cheese and sprinkle lightly with paprika (if desired).Bake, uncovered, for about 1 hour. Check the dish at about 45 minutes to make sure it is not browning too much.Let cool for just a couple of minutes before serving.