Bugfix: missing space name in the filename when writing to the file.

  * Added debugging messages and defined the constant CACHEREPORTSDIR
    in the controller.