Use Int instead of Int32

Int32 only works in 32 bit architectures. Use Int so that the code works with
both 32 bit and 64 bit architectures.
Change max to maximum

In Julia 2.0 max is deprecated in favor of maximum