Fix bugs and finish