Fixed HANDLE prototypes and added some convenient typedefs.