fcontainers fixes, refactoring and new tests