Replaced the constant filesDir by something that can be read from the
config file
Fixed one of the warnings of unused variables