Registration and some fixes