Fixing a bug which was returning a blank term