Make all of the unused pins an OUTPUT and code them LOW near the beginning of your program.