Fixes for previous commit. New tests.