Fix: Bower breaks with console exception when run on package directory

@gaurave 

Fixes #3790.