Tests and bug fixes.