MEGA2560 D13 Active During Upload

I have developed a custom ATMEL2560 PCB. I have D13 (pin 26 on uC) connected to a motorized door latch release. When I upload new code using the IDE or Visual Studio(with Visual Micro ext.), D13 goes active while upload occurs. Also pulses high 2 times when manually reset. I don't want the door latch to release when there is a power failure or reboot.

Could it be something to do with the ICSP? Not sure why as I'm not using D13 for ICSP - using D50-51 instead for ICSP. I'm flashed the Arduino bootstrap loaded by using a Genuine UNO as the programmer. I have no problems with uploading new code. My only problem is D13 becomes an active output - even when configured as an input.

Any suggestions on a root cause or clues toward finding a fix?

That is part of the arduino boot loader code. You can change the boot loader code or simply use another pin.

Why did you use an N-channel FET as a High Side driver? Typically P-channel is used there.

gilshultz:
That is part of the arduino boot loader code. You can change the boot loader code or simply use another pin.

Just out of interest, are you saying only D13 goes high or is it all Dx pins?