Reactivated cotire and some bug-fixes