Fix Ptr{T} and an off-by-one (fixes #3)