added a cast to allow this to compile under gcc 4.4.7 with debugging