fixing some NPEs and IUGATEWAY-241