After further investigation, the problem lies in this line of code:
while(!Serial);
The setup code will only execute if a serial connection is detected which is not available if power only is provided over USB. Commenting out this line of code fixes the problem.