Fixed bug in dependency checking