Code works on boot loader but not when directly programmed

mrjonny2:
I am using an AVRISP mkii.

How are you uploading exactly? What program? You should be able to examine the fuse settings. If so, can you tell us what they are?