Added some log statements for debugging.