Added handling of null arguments