Fix of Parse error: syntax error, unexpected T_RETURN, expecting T_FUNCTION which was introduced in version 2.5.21

+ code style optimizations