Fixed a bug with hero attacks and added some defensive checks