[WIP] More static typing fixes