Cleaned up embarassing serialization hack.