Fix most specs and improve the testing environment

Avoid using {...} for multi-line blocks.