Add some logging and fix a bug with manipulation.