fixed possible NPEs in master/fork environments