Fixed a bug with the dependancy check subroutine.