Fixed type and minor tweaks