Various code changes