Merge to master

Merge register functions into master line.