Megan is sometimes spelled with an “h” because it is a holdover from when Welsh names needed to be distinguishable from Irish names.