Type juggling and cleanup