Fix typeErrors