Fixed minor bugs and finished full merge