Fix some types to match the postgres implementation