Fixing some low-level runtime bugs and adding support for composite instances