Fix some incorrect types
Try to be more generic