Fixed embedding bugs