Various type fixes