Update tests and make them run fast.
Fix minor implementation issues.