Updated style. Fix some bugs