Updated to be compliant with PSR-4

Also fixed the call of a deprecated method (key_exists)