Smoothed out some bugs and sorted out the failing unit and acceptance tests