Compatibility with non ARC + some warnings

Hi @pedrovieira7,

Thanks for this helpful piece of code ;)
Just did some minor adjustments.

Cheers,
Hubert