Fix some type signature issues, still need to fix Int64 so works on 32-bit Julia