Fixed Resume not working

Also added some useful debugging messages.