fixed seh exception handling

This fixed the exception handling
The includes are in a more appropriate place now also