register and some fixes