Fixed quote method, adding NULL handling