Fixed all discovered bugs and continued PHP 5.5 migration