Fixed many bugs in preparation for the sprint 5 release