Support casting to id type. Improved documentation.