Some important fixes