Various code updates