Fixed a few bugs with the goal checking method.