Fix redefinitions and global pollution