Updated HANDLE type and added some typedefs.