Updated libs from SPH-M840 and cleanup