Modified to turn off all outputs before closing program
When program closes outputs go Hi-Z and MOSFETS go a bit funny
Consider 1Meg R between gate and ground