Tests and tweaks