added the UNIBO new checks, and updated code for PHP5.4 compatibility