Renamed component-count method, fixed breakage on path failure

Signed-off-by: Soumya Deb <debloper@gmail.com>