Fixed testing bugs ready to merch with master