Made various fixes