some debugging and module fixes