Improved null argument checks