Solves #46

Works with PHP => 5.3