Fix cube bug to caused segfaults when activating/deactivating.