Some fixes based on PSR-1 and PSR-2