Fix a number of unsafe operations (mostly forced unwrapping)

Swift is nice. I just searched for exclamation marks and made the program safer almost mechanically.
This can go inside the if let