Fix failing tests & clean up dir preparation