Merge local changes

Fixed using custom partial class, fixed using locale (may
introduce incompatibilities especially in handling float
values), fixed some preg_replace deprecated notices.