Fixed flattened profile behavior and added a test for it.