Added null type handling