improved null and various type handling