fixed some of the null parameter handling problems