Porting from 5XY

Porting from recent 5XY updates.
This is based on 'git merge' command, codes are fixed to be compiled in 7XY and just few tests were done.