Updates UTs and fixes bugs