Neccessary amend to pull #96 - still throws exceptions in some cases

amendment to fix the NPE which happens when building outside git